import type { ElementHiderRuleConfig } from '../../../types/constants'
import { ElementSelectorPosition, ElementSelectorType } from '../../../types/constants'
import { ELEMENT_IDENTIFIER_CONFIG } from '../../service/element_identifier/types'

export const FIVE_ONE_CTO_WEB_ELEMENT_CONFIG: ElementHiderRuleConfig = {
  [ELEMENT_IDENTIFIER_CONFIG.default.announcement.id]: {
    hide: true,
    selectorType: ElementSelectorType.Mix,
    selector: 'header.home-top',
    position: ElementSelectorPosition.TopCenter,
  },
  [ELEMENT_IDENTIFIER_CONFIG.default.header.id]: {
    hide: true,
    selectorType: ElementSelectorType.Complex,
    selector: '.Header:has(.header-content)',
    position: ElementSelectorPosition.TopCenter,
  },
  [ELEMENT_IDENTIFIER_CONFIG.blog.articleHr.id]: {
    hide: false,
    selectorType: ElementSelectorType.Mix,
    selector: '.article-detail .article-content-wrap .main-content hr',
    position: ElementSelectorPosition.MiddleCenter,
  },
  [ELEMENT_IDENTIFIER_CONFIG.default.leftAsideToolbar.id]: {
    hide: true,
    selectorType: ElementSelectorType.Mix,
    selector: '.action-aside.action-aside-left',
    position: ElementSelectorPosition.MiddleLeft,
  },
  [ELEMENT_IDENTIFIER_CONFIG.blog.authorInfo.id]: {
    hide: true,
    selectorType: ElementSelectorType.Complex,
    selector: '.detail-content-right > section:has(.user-content)',
    nameZh: '作者卡片',
    position: ElementSelectorPosition.MiddleRight,
  },
  [ELEMENT_IDENTIFIER_CONFIG.default.rank.id]: {
    hide: true,
    selectorType: ElementSelectorType.Complex,
    selector: '.detail-content-right > section.blogger-ranking',
    nameZh: '文章排行',
    position: ElementSelectorPosition.MiddleRight,
  },
  [ELEMENT_IDENTIFIER_CONFIG.default.classificationList.id]: {
    hide: true,
    selectorType: ElementSelectorType.Complex,
    selector: '.detail-content-right > section:has(#classification-list)',
    position: ElementSelectorPosition.MiddleRight,
  },
  [ELEMENT_IDENTIFIER_CONFIG.blog.featuredCourse.id]: {
    hide: true,
    selectorType: ElementSelectorType.Complex,
    selector: '.detail-content-right > .zcht',
    position: ElementSelectorPosition.MiddleRight,
  },
  [ELEMENT_IDENTIFIER_CONFIG.blog.recentArticles.id]: {
    hide: true,
    selectorType: ElementSelectorType.Complex,
    selector: '.detail-content-right > section:has(#updatelist)',
    position: ElementSelectorPosition.MiddleRight,
  },
  [ELEMENT_IDENTIFIER_CONFIG.blog.officialToc.id]: {
    hide: true,
    selectorType: ElementSelectorType.Complex,
    selector: '.detail-content-right > section:has(#directory-right)',
    position: ElementSelectorPosition.MiddleRight,
  },
  [ELEMENT_IDENTIFIER_CONFIG.default.minMenu.id]: {
    hide: true,
    selectorType: ElementSelectorType.Mix,
    selector: 'aside.minmenu',
    position: ElementSelectorPosition.MiddleRight,
  },
  [ELEMENT_IDENTIFIER_CONFIG.default.hoverBall.id]: {
    hide: true,
    selectorType: ElementSelectorType.Mix,
    selector: 'div.hover-ball',
    position: ElementSelectorPosition.MiddleCenter,
  },
  [ELEMENT_IDENTIFIER_CONFIG.blog.articleComment.id]: {
    hide: true,
    selectorType: ElementSelectorType.Mix,
    selector: '.detail-content-left #comment',
    position: ElementSelectorPosition.BottomCenter,
  },
  [ELEMENT_IDENTIFIER_CONFIG.blog.relatedRecommend.id]: {
    hide: true,
    selectorType: ElementSelectorType.Complex,
    selector: '.detail-content-left > section:has(.recommend-about)',
    nameZh: '相关文章',
    position: ElementSelectorPosition.BottomCenter,
  },
  [ELEMENT_IDENTIFIER_CONFIG.blog.recommendRead.id]: {
    hide: true,
    selectorType: ElementSelectorType.Mix,
    selector: '.detail-content-left .article-detail .recommend-ad',
    nameZh: '推荐文章',
    position: ElementSelectorPosition.BottomCenter,
  },
  [ELEMENT_IDENTIFIER_CONFIG.default.footer.id]: {
    hide: true,
    selectorType: ElementSelectorType.Mix,
    selector: 'div.Footer',
    position: ElementSelectorPosition.BottomCenter,
  },
}
